package com.efuture.chapterfour

/* @Description: List集合去重
 * @Auther: zhaoshanshan
 * @Date: 2022/03/06/6:55 下午
 */
fun main() {
    val list = listOf("zhaoshanshan","zhaoshanshan","liuyifan","chenhang","liuyifan");
    println(list)
   //第一种方式 将list集合转为set集合去除重复
    val set = list.toSet();
    println(set)
    //第二种 List转Set再转List
    val list1 = list.toSet().toList()
    println(list1)
    //第三种 快捷函数去重 distinct
    println(list.distinct())

}
    